import Vue from 'vue'
//引入element-ui
import ElementUI, {Message, MessageBox} from 'element-ui';
//引入element-ui需要的css文件
import 'element-ui/lib/theme-chalk/index.css';
//引入axios
import axios from 'axios';
import App from './App.vue'
import './registerServiceWorker'
import router from './router'
import store from './store'
import animate from 'animate.css'//引入动画依赖

Vue.config.productionTip = false


// 导入全局样式表
import '@/assets/css/base.css'
import '@/assets/css/global.css'

// 配置请求的跟路径
axios.defaults.baseURL = ' https://mock.kid007.cn/mock/618540f996b4330022cc21d6/milestone'
//设置路由守卫
axios.interceptors.request.use(config => {
  config.headers.Authorization = window.sessionStorage.getItem('token')
  return config
})


//使用element-ui
Vue.use(ElementUI);
Vue.use(animate)//使用动画依赖
Vue.prototype.$http = axios
//全局挂载element-ui的Message
Vue.prototype.$messag = Message
//全局挂载element-ui的MessageBox
Vue.prototype.$confirm = MessageBox.confirm

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
